<?php

/**
 * If you are not authorized to modify this file, do NOT touch it.
 * @file test.inc.php
 * @author deltamaster
 * @date 2010-12-1
 * @description The file which should be included by any application based on this framework.
 */

if (!defined('IN_IMBA')) exit('Access Denied.');

/**
 * The following definitions are for portability issues.
 */
if (!defined('IMBA_LIB')) define('IMBA_LIB', dirname(__file__) . '/');
define('IMBA_PATH', dirname(__file__) . '/../');
define('IMBA_CONFIG_DIR', IMBA_PATH . 'config/');
define('IMBA_INSTALL_DIR', IMBA_PATH . 'install/');
define('IMBA_CACHE_DIR', IMBA_PATH . 'cache/');
define('IMBA_TEMPLATE_DIR', IMBA_PATH . 'template/');
define('IMBA_LANGUAGE_DIR', IMBA_PATH . 'language/');

/**
 * Database type definitions.
 */
define('DB_NULL', 0); //Need no database.
define('DB_TYPE_MYSQL', 1);
define('DB_TYPE_ORACLE', 2);
define('DB_TYPE_MSSQL', 3);

/**
 * Exception type definitions.
 */
$e_detail = array();
define('E_UNKNOWN', 0);
$e_detail[E_UNKNOWN] = array('abbr' => 'UNKNOWN', 'desc' => 'Unknown exception.', 'msg' => 'We have encountered an unknown error. Sorry for the inconvenience.');
define('E_DB_CONNECT', 10001);
$e_detail[E_DB_CONNECT] = array('abbr' => 'DB_CONNECT', 'desc' => '', 'msg' => 'Database connection failed. Please check the status of your database service or the content of your configuration file "db.conf.php".');
define('E_DB_NODB', 10002);
$e_detail[E_DB_NODB] = array('abbr' => 'DB_NODB', 'desc' => '', 'msg' => 'Running under no database mode. No database available. Modify "global.conf.php" if your application should have access to the database.');
define('E_DB_QUERY_FAIL', 10003);
$e_detail[E_DB_QUERY_FAIL] = array('abbr' => 'DB_QUERY_FAIL', 'desc' => '', 'msg' => 'An unsuccessful SQL query. Turn on debug mode to locate the problem.');
define('E_MATH_DIV_BY_ZERO', 20000);
$e_detail[E_MATH_DIV_BY_ZERO] = array('abbr' => 'MATH_DIV_BY_ZERO', 'desc' => '', 'msg' => 'Devision by zero. Turn on debug mode to locate the problem.');
define('E_FS_NOT_EXIST', 30000);
$e_detail[E_FS_NOT_EXIST] = array('abbr' => 'FS_NOT_EXIST', 'desc' => '', 'msg' => 'Specified file not exists. Turn on debug mode to locate the problem.');
define('E_FS_READ_FAIL', 30001);
$e_detail[E_FS_READ_FAIL] = array('abbr' => 'FS_READ_FAIL', 'desc' => '', 'msg' => 'Fail to read specified file. Turn on debug mode to locate the problem.');
define('E_FS_WRITE_FAIL', 30002);
$e_detail[E_FS_WRITE_FAIL] = array('abbr' => 'FS_WRITE_FAIL', 'desc' => '', 'msg' => 'Fail to write specified file. Turn on debug mode to locate the problem.');
define('E_AUTH_DISABLED', 40001);
$e_detail[E_AUTH_DISABLED] = array('abbr' => 'AUTH_DISABLED', 'desc' => '', 'msg' => 'Basic authentication diabled, check the configuration file please.');

?>